@import "../../base.less";

@import "./_var.less";

.@{prefix}-swiper {
  position: relative;
  box-sizing: border-box;
  font-weight: normal;
  border-radius: @swiper-border-radius;

  &-item {
    width: 100%;
    flex-shrink: 0;
  }

  &__btn {
    display: inline-block;
    width: @swiper-page-btn-size;
    height: @swiper-page-btn-size;
    background-color: @text-color-secondary;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: @gray-color-1;
    line-height: @swiper-page-btn-size;
    text-align: center;

    & > .el-p-icon {
      position: relative;
      top: -2px;
    }

    &.btn-prev {
      left: 10px;
    }

    &.btn-next {
      right: 10px;
    }
  }

  // 分页
  &__pagination {
    display: inline-block;
    font-size: 0;

    &-fraction {
      height: @swiper-page-fraction-height;
      line-height: @swiper-page-fraction-height;
      background-color: @text-color-placeholder;
      color: @gray-color-1;
      padding: 0 12px;
      border-radius: @swiper-page-fraction-radius;
      font-size: 12px;
    }

    .@{prefix}-swiper-dot {
      display: inline-block;
      width: @swiper-page-dot-size;
      height: @swiper-page-dot-size;
      border-radius: 3px;
      background: @mask-disabled;
      margin: 0 4px;

      &--active {
        background-color: @gray-color-1;
      }
    }

    &-dots-bar .@{prefix}-swiper-dot--active {
      width: @swiper-page-dot-active-width;
    }

    &-left.@{prefix}-swiper__pagination-dots,
    &-left.@{prefix}-swiper__pagination-dots-bar,
    &-left.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
    }

    &-right.@{prefix}-swiper__pagination-dots,
    &-right.@{prefix}-swiper__pagination-dots-bar,
    &-right.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
    }

    &-top-left.@{prefix}-swiper__pagination-dots,
    &-top-left.@{prefix}-swiper__pagination-dots-bar,
    &-top-left.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      top: 12px;
      left: 12px;
    }

    &-top.@{prefix}-swiper__pagination-dots,
    &-top.@{prefix}-swiper__pagination-dots-bar,
    &-top.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      left: 50%;
      top: 12px;
      transform: translateX(-50%);
    }

    &-top-right.@{prefix}-swiper__pagination-dots,
    &-top-right.@{prefix}-swiper__pagination-dots-bar,
    &-top-right.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      top: 12px;
      right: 12px;
    }

    &-bottom-left.@{prefix}-swiper__pagination-dots,
    &-bottom-left.@{prefix}-swiper__pagination-dots-bar,
    &-bottom-left.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      left: 12px;
      bottom: 12px;
    }

    &-bottom.@{prefix}-swiper__pagination-dots,
    &-bottom.@{prefix}-swiper__pagination-dots-bar,
    &-bottom.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      left: 50%;
      bottom: 12px;
      transform: translateX(-50%);
    }

    &-bottom-right.@{prefix}-swiper__pagination-dots,
    &-bottom-right.@{prefix}-swiper__pagination-dots-bar,
    &-bottom-right.@{prefix}-swiper__pagination-fraction {
      position: absolute;
      right: 12px;
      bottom: 12px;
    }
  }

  // 主要容器
  &__container {
    height: 100%;
    width: auto;
    position: relative;
    display: flex;
  }

  &__item {
    overflow: hidden;

    img {
      height: 100%;
      width: 100%;
    }
  }
}
